<div class="main mt10" >
    <!-- Star of area2s -->
    <div class="area2s">
    	<!-- Star of Col1 -->
    	<div class="col1">
			<div class="breadCrumb">
				<div class="fl"><span class="cRed fb">当前位置：</span>&nbsp;<?php echo CHtml::link('首页', array('/')); ?>&nbsp;›&nbsp;<?php echo CHtml::link('在线问吧', array('/qas')) ?>&nbsp;›&nbsp;<strong>搜索结果“<?php echo $key ?>”</strong></div>
			</div> 
			<div class="qasContent mt10">
				<ul class="qasTabs">
				<?php if(count($errors) > 0) : ?>
					<li><?php echo CHtml::link('<span>'.$errors[0].'</span>', array(), array('class' => 'active')); ?></li>
				<?php elseif(count($qAs) > 0) : ?>
					<li><?php echo CHtml::link('<span>搜索结果：“'.$key.'”</span>', array(), array('class' => 'active')); ?></li>
				<?php else : ?>
					<li><?php echo CHtml::link('<span>没有找到“'.$key.'”的相关结果</span>', array(), array('class' => 'active')); ?></li>
				<?php endif; ?>
				</ul>
				<div class="cb"></div>
				<ul class="qasLists fl" id="qasLists">
					<li>
                    	<ul class="qasLists-items" id="qasLists-items">
                    		<?php $count = count($qAs); ?>
                    		<?php foreach($qAs as $k => $_qA) : ?>
                    		<?php $lastReply = $_qA->getLastReply(); ?>
                        	<li class="item<?php if($k%2 === 1) : ?> alt<?php endif; ?>"<?php if($count == $k+1) : ?> id="styleNone1"<?php endif; ?>>
                                <table cellpadding="0" cellspacing="0" border="0" width="100%" class="t1">
                                    <tbody>
                                        <tr class="cHui1">
                                            <td class=""><span class="author">由&thinsp;<a href="#"><?php echo $_qA->author->userName(); ?></a>&thinsp;</span><span class="dateline">发表于<?php echo fromNow($_qA->qaDate); ?></span></td>
                                            <td class="lastPost tr"><?php if($lastReply !== null && $lastReply->author->getIsAdmin()) : ?>咨询师 <a href="<?php echo CHtml::normalizeUrl(array('/users/viewprofile', 'id' => $lastReply->author->uid)) ?>"><?php echo $lastReply->author->username ?></a> 回复于<span class="data"><?php echo fromNow($lastReply->qaDate); ?></span><?php else : ?>等待回复<?php endif ?></td>
                                        </tr>
                                        <tr>
                                            <td class="title"><a href="<?php echo CHtml::normalizeUrl(array('/qas/view', 'id' => $_qA->qaId)); ?>"><?php $this->beginWidget('CHtmlPurifier'); ?><?php echo $_qA->qaTitle; ?><?php $this->endWidget('CHtmlPurifier'); ?></a><span class="status<?php if($_qA->qaStatus == QAs::STATUS_UNSOLVED) : ?> cOrg<?php elseif($_qA->qaStatus == QAs::STATUS_SOLVED): ?> cGre<?php endif; ?>">[<?php echo $_qA->getStatusText(); ?>]</span></td>
                                            <td class="tr"><?php if( ! empty($_qA->replied)) : echo fromNow($_qA->replied); endif; ?></td>
                                        </tr>
                                        <tr>
                                            <td class="content"><?php $this->beginWidget('CHtmlPurifier'); ?><?php echo truncStr($_qA->qaContent, 360, '...'); ?><?php $this->endWidget('CHtmlPurifier'); ?></td>
                                        	<td class=""></td>
                                        </tr>
                                    </tbody>
								</table>
                            </li>
                            <?php endforeach; ?>
                        </ul>     
					</li>
				</ul>
				<div class="cb"></div>
				<div class="mt10"></div>
				<?php $this->widget('CLinkPager', array('pages' => $pages)); ?>
                <div class="cb"></div>
			</div>
        </div>
        <!-- End of Col1 -->
        <!-- Star of Col2 -->
        <div class="col2">
        	<?php echo CHtml::form(array('/qas/search'), 'get', array('id' => 'qas_search_form')); ?>
	        <div class="search">	
				<h3 class="cRed"><span class="icon"></span>咨询提问</h3>
	            <p><input name="key" type="text" size="15" value="<?php echo $key ?>" class="sIpt"/><br />
				<input value="搜索" type="submit" class="sBtn mt10" />
	            </p>
	        </div>
        	<?php echo CHtml::endForm(); ?>
	        <br />
			<?php $this->widget('QAsHistory') ?>
        	<?php $this->widget('RandomPsy'); ?>
        </div>
        <!-- End of Col2 -->
    </div><!-- End of area3s -->
</div>
